// \src\auth.js

// 存储token
export const setToken = (token)=>{
    localStorage.setItem('authToken', token);
}

// 获取token
export const getToken =()=>{
    return localStorage.getItem('authToken')

}

// 删除token
export const removeToken =()=>{
    localStorage.removeItem('authToken')
    sessionStorage.clear()
}

//校验 token
export const isLogin=()=>{
    return !!getToken(); // !! 转换为布尔值
}



